import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "index",
    component: () => import("../pages/index/index.vue"),
  },
  {
    path: "/contract",
    name: "contract",
    component: () => import("../pages/contract/contract.vue"),
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../pages/login/login.vue"),
  },
  {
    path: "/home",
    name: "home",
    component: () => import("../pages/home.vue"),
    children: [
      {
        path: "/",
        name: "weChat",
        component: () => import("../pages/weChat/index1.vue"),
        meta: {
          title: "AI客服配置",
          subtitle: "微信列表",
        },
      },
      {
        path: "/weChat",
        name: "weChat",
        component: () => import("../pages/weChat/index1.vue"),
        meta: {
          title: "AI客服配置",
          subtitle: "微信列表",
        },
      },
      {
        path: "/repository",
        name: "repository",
        component: () => import("../pages/repository/index.vue"),
        meta: {
          title: "AI客服配置",
          subtitle: "知识库列表",
        },
      },
      {
        path: "/repository_manage",
        name: "repository_manage",
        component: () => import("../pages/repository_manage/index.vue"),
        meta: {
          title: "知识库",
          subtitle: "知识库管理",
          isBack: true,
        },
      },
      {
        path: "/chatting",
        name: "chatting",
        component: () => import("../pages/chatting/index.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "聊天会话",
        },
      },
      {
        path: "/timing_message",
        name: "timing_message",
        component: () => import("../pages/timing_message/index1.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "定时消息",
        },
      },
      {
        path: "/create",
        name: "create",
        component: () => import("../pages/timing_message/create.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "定时消息 > 创建定时消息",
          isBack: true,
        },
      },
      {
        path: "/task",
        name: "task",
        component: () => import("../pages/timing_message/task.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "定时消息 > 任务管理",
          isBack: true
        }
      },
      {
        path: "/latest",
        name: "latest",
        component: () => import("../pages/latest/index1.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "跟进列表",
        },
      },
      {
        path: "/report",
        name: "report",
        component: () => import("../pages/report/report.vue"),
        meta: {
          title: "聊天管理",
          subtitle: "报表设置",
          isBack: true,
        },
      },
      {
        path: "/my_service",
        name: "my_service",
        component: () => import("../pages/my_service/index.vue"),
        meta: {
          title: "我的",
          subtitle: "我的服务",
        },
      },
      {
        path: "/sub_account",
        name: "sub_account",
        component: () => import("../pages/sub_account/index.vue"),
        meta: {
          title: "我的",
          subtitle: "我的子账号",
        },
      },
      {
        path: "/entry_level",
        name: "entry_level",
        component: () => import("../pages/entry_level/entry_level.vue"),
        meta: {
          title: "帮助支持",
          subtitle: "快速入门",
        },
      },
      {
        path: "/faq",
        name: "faq",
        component: () => import("../pages/faq/faq.vue"),
        meta: {
          title: "帮助支持",
          subtitle: "常见FAQ",
        },
      },
      {
        path: "/online_service",
        name: "online_service",
        component: () => import("../pages/online_service/online_service.vue"),
        meta: {
          title: "帮助支持",
          subtitle: "在线服务",
        },
      },
      // 管理员权限展示的路由
      {
        path: "/admin_wechat",
        name: "admin_wechat",
        component: () => import("../pages/admin/wechat/index.vue"),
        meta: {
          title: "管理员",
          subtitle: "管理微信",
        },
      },
      // 管理员权限展示的路由
      {
        path: "/admin_model",
        name: "admin_model",
        component: () => import("../pages/admin/model/index.vue"),
        meta: {
          title: "管理员",
          subtitle: "管理模型",
        },
      },
      // 管理应用
      {
        path: "/admin_application",
        name: "admin_application",
        component: () => import("../pages/admin/wechat/application.vue"),
        meta: {
          title: "管理员",
          subtitle: "管理应用",
        },
      },
      // 管理提示词
      {
        path: "/admin_prompt",
        name: "admin_prompt",
        component: () => import("../pages/admin/prompt/index.vue"),
        meta: {
          title: "管理员",
          subtitle: "管理角色",
        },
      },
      // 编辑提示词
      {
        path: "/admin_edit_prompt",
        name: "admin_edit_prompt",
        component: () => import("../pages/admin/prompt/prompt.vue"),
        meta: {
          title: "管理员",
          subtitle: "编辑提示词",
        },
      },
      // 管理体验Agent
      {
        path: "/admin_agent",
        name: "admin_agent",
        component: () => import("../pages/admin/tiyan/index.vue"),
        meta: {
          title: "管理员",
          subtitle: "管理体验Agent",
        },
      },
      // 管理体验Agent
      {
        path: "/admin_edit_agent",
        name: "admin_edit_agent",
        component: () => import("../pages/admin/tiyan/agent.vue"),
        meta: {
          title: "管理员",
          subtitle: "编辑体验Agent",
        },
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
